        [section .text]
        [bits 32]
        global  _init_interrupt
        extern  CS_Desc
        extern	_tsccount
        extern  IDTR_rm_Val
_init_interrupt:
        pushad
        mov     ebx, Timer_IDT_Desc
        mov     eax, TimerInt
        mov     word [ebx], ax
        shr     eax, 16
        mov     word [ebx + 6], ax
        mov     eax, CS_Desc
        mov     word [ebx + 2], ax
        sidt    [IDTR_rm_Val]
        lidt    [IDTR_Val]
        sti
        popad
        retn
        
        
        
        extern _timer_service
TimerInt:
        pushad
        call    near _timer_service
        rdtsc
        mov	[_tsccount], eax 
        mov     al, 20h
        out     20h, al
        popad
        iretd
        
       
       
      
        [section .data]
Empty_IDT_Desc:
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
        dw      0
        dw      0
        dw      8e00h
        dw      0
Timer_IDT_Desc:
        dw      0
        dw      0
        dw      8e00h
        dw      0
IDTDesc_len     equ     $ - Empty_IDT_Desc
IDTR_Val:
        dw      IDTDesc_len - 1   
        dd      Empty_IDT_Desc